/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ats.ereg.model.entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Ali
 */
@Entity
@Table(name = "tst_courses")
@NamedQueries({
    @NamedQuery(name = "TstCourses.findAll", query = "SELECT t FROM TstCourses t")})
public class TstCourses implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    private Integer id;
    @Basic(optional = false)
    private String name;
    @Basic(optional = false)
    @Column(name = "crdt_hrs")
    private String crdtHrs;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tstCourses")
    private List<TstStdCourses> tstStdCoursesList;

    public TstCourses() {
    }

    public TstCourses(Integer id) {
        this.id = id;
    }

    public TstCourses(Integer id, String name, String crdtHrs) {
        this.id = id;
        this.name = name;
        this.crdtHrs = crdtHrs;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCrdtHrs() {
        return crdtHrs;
    }

    public void setCrdtHrs(String crdtHrs) {
        this.crdtHrs = crdtHrs;
    }

    public List<TstStdCourses> getTstStdCoursesList() {
        return tstStdCoursesList;
    }

    public void setTstStdCoursesList(List<TstStdCourses> tstStdCoursesList) {
        this.tstStdCoursesList = tstStdCoursesList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TstCourses)) {
            return false;
        }
        TstCourses other = (TstCourses) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ats.ereg.model.entities.TstCourses[ id=" + id + " ]";
    }
    
}
